<html>
<head> 
<script  type = "text/javascript"  src = "js/ejs.js" ></script>
<script  type = "text/javascript" >  
 function myfunction(){
 var data='{"title":"cleaning","supplies":["mop","broom","duster"]}'  
 var html = new EJS({url: 'js/cleaning.ejs'}).render(JSON.parse(data));    
 //JSON.parse(data) 把JSON字符串解析为原生的javascript值。    
 alert(html);  
 document.getElementById("div1").innerHTML=html; }
 </script>
 </head>
 <body> 
 <button  onclick = "myfunction()" >点击</ button > 
 <div  id= "div1"></div>
 </body>
 <html>
